libxl: Enhance libxl__sendmsg_fds to deal with EINTR and EWOULDBLOCK
authorAnthony PERARD <anthony.perard@citrix.com>
Wed, 31 Oct 2018 16:31:49 +0000 (16:31 +0000)
committerWei Liu <wei.liu2@citrix.com>
Fri, 11 Jan 2019 14:57:25 +0000 (14:57 +0000)
commit394dd1d2d49afe31432985c6c517a0a80b9c20fd
treea1d180660b26fa50b43ea377ec7f3372bc4f01f6
parenta67ce55a3e511104e0212bfbafda5215c74e07c7
libxl: Enhance libxl__sendmsg_fds to deal with EINTR and EWOULDBLOCK

This patch change the behavior of libxl__sendmsg_fds to retry sendmsg on
EINTR error and return an error on short writes.

This patch allow a caller of libxl__sendmsg_fds to deal with EWOULDBLOCK
and short writes. The function now requires to send only 1 byte of data
so that when dealing with non-blocking fds a EWOULDBLOCK error would
mean that the fds haven't been sent yet. Current caller already send
only 1 byte.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ wei: fix build ]
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl_internal.h
tools/libxl/libxl_utils.c